#include <QFileDialog>

#include <QLineEdit>
#include <QtPlugin>
#include <QWidget>
#include <QVBoxLayout>
#include <QPushButton>

#include <opencv/cv.h>
#include <opencv/highgui.h>

#include "QCVModuleInterface.h"
#include "QCVModuleHandlerInterface.h"

#ifndef MODULE_DATA_WRITTER
#define MODULE_DATA_WRITTER

class ModuleDataWritter:public QObject,QCVModuleInterface
{

	Q_OBJECT
	Q_INTERFACES(QCVModuleInterface)
		
	public:
		void init(QCVModuleHandlerInterface * parent);
		void free();

		cv::Mat & process();
		void setInput(int n,const cv::Mat & m);

		QWidget* widget();
		QString getName();
		int nbInputs();
		QString help(int id);
		bool setParams(QString params);
    QString getParams();

	public slots:
		void s_browse();		
		void s_open();
	
	private:
		
		QLineEdit * l_path;
		QPushButton * pb_browse;

		cv::FileStorage file;		
		
		QWidget * win;
    QHBoxLayout * layout;
		QCVModuleHandlerInterface * parent;

};

#endif
